//求一个数字各位数字的累加和
import java.util.Scanner;
public class test{
    public static int SumNumber(int n){
        int sum=0;
        while(n!=0){
            int tem=n%10;
            n=n/10;
            sum+=tem;
        }
        return sum;
    }
    public static void main(String[] args) {
        int a=0;
        int b=0;
        Scanner sc=new Scanner(System.in);
        a=sc.nextInt();
        b=SumNumber(a);
        System.out.println(b);

    }
}
